<?php
namespace Home\Controller;
use Think\Controller;
class MoodController extends Controller {
    public function index(){
    	$where = array();
        if (I('key')) {
            $where['content'] = array('like','%'.I('key').'%');
        }
        $map['state'] = 1;
    	$this->list = M("Mood")->Where($where)->Where($map)->order('addtime desc')->Select();
		$this->display();
    }
    public function show(){  	    	
        $map['id'] = I('get.id');
		$map['state'] = 1;
        $show =  M("Mood")->where($map)->find();
		if(!$show){
			$this->error(M("Mood")->getError());
		}else{
			$this->assign('info',$show);
			$shows->setInc('vie',1); // 文章阅读数加1
		}
        $this->display();
    }
}